package com.cq.hd.member.api;

import com.cq.hd.common.pagination.Page;
import com.cq.hd.common.response.Result;
import com.cq.hd.member.api.dto.*;
import com.cq.hd.member.api.vo.BusinessEnterApplyDetailVo;
import com.cq.hd.member.api.vo.BusinessEnterApplyPageVo;
import com.cq.hd.member.api.vo.BusinessEnterApplyVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = "hd-o2o-member-service", contextId = "business-enter-apply-api")
public interface TbBusinessEnterApplyApi {

    // 列表
    @GetMapping("/member/businessEnterApply/pageBusinessEnterApply")
    Result<Page<BusinessEnterApplyPageVo>> pageBusinessEnterApply(@SpringQueryMap BusinessEnterApplyPageDto businessEnterApplyPageDto);

    // 详情
    @GetMapping("/member/businessEnterApply/details")
    Result<BusinessEnterApplyPageVo> details(@RequestParam("id") Long id);

    // 商家入驻审核
    @PostMapping("/member/businessEnterApply/audit")
    Result<Boolean> audit(@RequestBody BusinessEnterAuditDto businessEnterAuditDto);

    // 商家入驻申请
    @PostMapping("/member/businessEnterApply/apply")
    Result<Boolean> apply(@RequestBody BusinessEnterApplyDto businessEnterApplyDto);

    // 更新商家入驻信息
    @PutMapping("/member/businessEnterApply/updateBusinessEnterApplyById")
    Result<Boolean> updateBusinessEnterApplyById(@RequestBody BusinessEnterApplyUpdateDto businessEnterApplyUpdateDto);

    // 商家入驻成功处理商家账号和绑定处理
    @PostMapping("/member/businessEnterApply/enterSuccess")
    Result<Boolean> enterSuccess(@RequestParam("id") Long id);

    // 手动开通商户业务
    @PostMapping("/member/businessEnterApply/merchantOpen")
    Result<Boolean> merchantOpen(@RequestBody MerchantOpenDto merchantOpenDto);

    // 手动开通子账号
    @PostMapping("/member/businessEnterApply/merchantSubAcctOpen")
    Result<Boolean> merchantSubAcctOpen(@RequestBody MerchantSubAcctOpenDto merchantSubAcctOpenDto);

    // 根据用户id获取商家入驻数据
    @PostMapping("/member/businessEnterApply/getEnterInfoByUserId")
    Result<BusinessEnterApplyVo> getEnterInfoByUserId(@RequestParam("userId") Long userId);

    // 根据条件获取商家入驻列表
    @PostMapping("/member/businessEnterApply/listByDto")
    Result<List<BusinessEnterApplyPageVo>> listByDto(@RequestBody BusinessEnterApplyQueryDto businessEnterApplyQueryDto);

    // 定时检测商家是否签约成功和微信实名成功
    @PostMapping("/member/businessEnterApply/scanBusinessEnter")
    Result<Boolean> scanBusinessEnter();

    // 根据手机号获取商家入驻成功记录数据
    @GetMapping("/member/businessEnterApply/getSuccessEnterInfoByOpenid")
    Result<BusinessEnterApplyDetailVo> getSuccessEnterInfoByOpenid(@RequestParam("openid") String openid);

    // 校验邀请码是否有效
    @GetMapping("/member/businessEnterApply/validSettleCode")
    Result<Boolean> validSettleCode(@RequestParam("settleCode") String settleCode);
}
